#ifndef JOINTCONTROL_H
#define JOINTCONTROL_H

#include <QObject>
#include <QSlider>
#include <QDoubleSpinBox>
#include <QCheckBox>
#include <QGroupBox>
#include <QLabel>
#include <QString>
#include <QWidget>
#include <QHBoxLayout>


class JointControl : public QWidget
{
	Q_OBJECT

	public:
		JointControl(int joint_number, int joint_type, float min, float max, float start_value);
		
	public slots:
		void setValue(float value);
		void setActionStatus(int status);
		void setFocus(int joint);

	signals:
		void valueChanged(int,float);
		void grabFocus(int);

	private:
		QSlider *slider;
		QDoubleSpinBox *spinbox;
		QCheckBox *checkBox;
		QCheckBox *focusBox;
		QLabel *actionLabel;
		
		QGroupBox *groupBox;
		QHBoxLayout *controlLayout;
		QHBoxLayout *hBox;


		int jointNumber;
		int jointType;
		double currentValue;
		double minimum;
		double maximum;
		int checked;
		
		bool inFocus;
		
		int iMinimum;
		int iMaximum;
		int iCurrentValue;
		int iSliderSteps;
		int iPageStep;

	private slots:
		void sliderChanged(int value);
		void spinBoxChanged(double value);
		void actionStatusChanged(int checked);
		void focusBoxClicked(bool checked);
};
#endif
